package cn.itcast.com.exception;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class demo2 {
    public static void main(String[] args) {
        try {
            int i = 1;
            //int j = i/0;
            System.out.println("after / by zero");
            int[] ints = new int[3];
            System.out.println(ints[3]);
            System.out.println("after ArrayIndexOutOfBoundsException");
            ints = null;
            System.out.println(ints.length);
            System.out.println("after NullPointerException");
        }catch (ArithmeticException e){
            System.out.println("运算异常");
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println("数组异常");
        }catch (NullPointerException e){
            System.out.println("空指针异常");
        }
    }
}
